<template>
    <router-link to="/detail">detail</router-link>
    <el-form ref="signFormRef" :model="signForm" label-width="500px" :rules="signFormRule">
        <el-form-item prop="phone">
            <el-input v-model="signForm.phone" class="w-50 m-2" placeholder="手机号" :prefix-icon="User"/>
        </el-form-item>
    </el-form>
  <!--    抽屉按钮-->
    <el-button type="primary" style="margin-left: 16px" @click="drawer = true">
        open
    </el-button>
  <!--抽屉列表-->
    <el-drawer v-model="drawer" title="I am the title" :with-header="false">
        <span>Hi there!</span>
        <el-table :data="argList.tableData">
            <el-table-column prop="id" label="id"/>
            <el-table-column prop="type" label="type"/>
            <el-table-column prop="plan" label="plan"/>
            <el-table-column prop="date" label="date"/>
            <el-table-column prop="title" label="操作">
                <template #default="scope">
                    <el-button type="" @click="addSecKillListOne(scope.row)">yi</el-button>
                </template>
            </el-table-column>
        </el-table>
    </el-drawer>
</template>

<script lang="ts" setup>
import {onMounted, reactive, ref} from 'vue'

const drawer = ref(false)
import {Lock, User} from '@element-plus/icons-vue'

const argList = reactive({
    tableData: [],
})

onMounted(() => {
    console.log(sessionStorage.getItem('tableData'));
    // sessionStorage.clear();
    if (sessionStorage.getItem('tableData') !== null) {
        argList.tableData = JSON.parse(sessionStorage.getItem('tableData'));
    }
})

const signForm = reactive({
    phone: '',
    password: ''
})

const signFormRule = {
    phone: [
        // {required: true, message: '未填写手机号'},
        // {min: 11, message: '请输入不少于2个字符', trigger: 'blur'},
        {pattern: /^(,*-?\d+){1,4}$/, message: '手机号格式不正确'}
    ],
}
</script>
<style scoped>
</style>
